package com.tianpengtech.common.model.user;

import com.tianpengtech.common.model.AbstractBaseModel;

/**
 * Created by Administrator on 2017/5/28 0028.
 */
public class Session extends AbstractBaseModel< Session > {

    public static final Session dao = new Session();


    public static final String ID ="id"; //SessionID
    public static final String USERID ="userId"; //用户ID
    public static final String EXPIREAT ="expireAt"; //过期时间



    @Override
    public String tableName() {
        return "fair_session";
    }

    /**
     * 登录会话是否已过期
     */
    public boolean isExpired() {
        return getLong(EXPIREAT) < System.currentTimeMillis();
    }

}
